package com.ebupt.migu.music.siginIn.controller;

import com.alibaba.fastjson.JSONObject;
import com.ebupt.migu.music.common.entity.ResultObject;
import com.ebupt.migu.music.common.util.ReqestParamUtil;
import com.ebupt.migu.music.siginIn.service.SiginInService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/siginIn")
public class SiginInController {

    @Autowired
    HttpServletRequest request;
    @Resource
    private SiginInService siginInService;

    /**
     * 同步服务云运营平台用户信息到推荐运营系统(一级系统)
     *
     * @return
     */
    @RequestMapping("/synchroniUserWalle")
    public ResultObject synchroniUserWalle() {
        Map<String, Object> map = ReqestParamUtil.getParams(request);
        return siginInService.synchroniUserWalle(map);
    }

    /**
     * 单点登录TOKEN验证接口
     *
     * @return
     */
    @RequestMapping("/getSiginUserInfo")
    public JSONObject getSiginUserInfo(@RequestBody Map<String, Object> map) {
        return siginInService.getSiginUserInfo(map);
    }
}
